package fz;

public class Student {
    String name;
    private int age;

    //set   get
    public void setAge(int a){
        if(a<0 || a>120){
            System.out.println(" 你输入的年龄有误 ");
        }else {
            age = a;
        }
    }

    public int getAge(){
        return age;
    }


    public void show(){
        System.out.println(name+"---"+age);
    }
}